var express = require('express');
var router = express.Router();
var fs = require("fs");
var path = require("path");

//聊天室页面
router.get('/', function (req, res, next) {

    fs.exists(__dirname+"/../views/commentbox.html", function (exists) {
        if(exists){
            fs.readFile(__dirname+"/../views/commentbox.html", function (err, data) {
                if (err) throw err;
                res.setHeader('Content-Type','text/html; charset=utf-8');
                res.end(data);
            });
        }else{
            next();
        }

    });

});

module.exports = router;
